package com.upc.feedish;

import androidx.appcompat.app.AppCompatActivity;


import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.WindowManager;
import android.widget.TextView;


public class WelcomeActivity extends AppCompatActivity {
    TextView tv_version;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
//        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
//        init();

        //设置全屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
//        //隐藏顶部标题栏,闪退
//        getSupportActionBar().hide();//加了这句就闪退？？？？？？
        handler.sendEmptyMessageDelayed(0,2000);
    }
    //重写Handler类中handleMessage（）方法
    private Handler handler=new Handler(){
        @Override
        public void handleMessage(Message msg){
            //实现页面的跳转
            Intent intent=new Intent(WelcomeActivity.this,MainActivity.class);
            startActivity(intent);
            finish();
            super.handleMessage(msg);
        }
    };
}